package cyou.breathe.blog.article.infrastructure.exception;

import cyou.breathe.blog.base.exception.ErrorCode;

/**
 * @author: breathe
 * @createTime: 2025-08-29
 */
public enum ArticleErrorCode implements ErrorCode {
    ARTICLE_NOT_EXIST("ARTICLE_NOT_EXIST", "文章不存在"),
    ARTICLE_NOT_AUTHOR("ARTICLE_NOT_AUTHOR", "文章不是作者"),
    ARTICLE_NOT_PUBLISHED("ARTICLE_NOT_PUBLISHED", "文章未发布"),
    ARTICLE_NOT_DRAFT("ARTICLE_NOT_DRAFT", "文章不是草稿"),
    ARTICLE_NOT_DELETED("ARTICLE_NOT_DELETED", "文章未删除"),
    ARTICLE_CREATE_FAILED("ARTICLE_CREATE_FAILED", "文章创建失败"),
    ARTICLE_UPDATE_FAILED("ARTICLE_UPDATE_FAILED", "文章修改失败"),
    ARTICLE_CREATE_DUPLICATE("ARTICLE_CREATE_DUPLICATE", "文章已存在"),
    ARTICLE_GET_FAILED("ARTICLE_GET_FAILED", "文章获取失败"),
    ARTICLE_DELETE_FAILED("ARTICLE_DELETE_FAILED", "文章删除失败"),
    ;

    private String code;
    private String message;

    ArticleErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
